package com.binest.votingRecords.service.impl;

import java.util.List;
import com.binest.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.binest.votingRecords.mapper.VotingRecordsMapper;
import com.binest.votingRecords.domain.VotingRecords;
import com.binest.votingRecords.service.IVotingRecordsService;

/**
 * 投票记录Service业务层处理
 * 
 * @author binest
 * @date 2024-03-28
 */
@Service
public class VotingRecordsServiceImpl implements IVotingRecordsService 
{
    @Autowired
    private VotingRecordsMapper votingRecordsMapper;

    /**
     * 查询投票记录
     * 
     * @param id 投票记录主键
     * @return 投票记录
     */
    @Override
    public VotingRecords selectVotingRecordsById(String id)
    {
        return votingRecordsMapper.selectVotingRecordsById(id);
    }

    /**
     * 查询投票记录列表
     * 
     * @param votingRecords 投票记录
     * @return 投票记录
     */
    @Override
    public List<VotingRecords> selectVotingRecordsList(VotingRecords votingRecords)
    {
        return votingRecordsMapper.selectVotingRecordsList(votingRecords);
    }

    /**
     * 新增投票记录
     * 
     * @param votingRecords 投票记录
     * @return 结果
     */
    @Override
    public int insertVotingRecords(VotingRecords votingRecords)
    {
        votingRecords.setCreateTime(DateUtils.getNowDate());
        return votingRecordsMapper.insertVotingRecords(votingRecords);
    }

    /**
     * 修改投票记录
     * 
     * @param votingRecords 投票记录
     * @return 结果
     */
    @Override
    public int updateVotingRecords(VotingRecords votingRecords)
    {
        votingRecords.setUpdateTime(DateUtils.getNowDate());
        return votingRecordsMapper.updateVotingRecords(votingRecords);
    }

    /**
     * 批量删除投票记录
     * 
     * @param ids 需要删除的投票记录主键
     * @return 结果
     */
    @Override
    public int deleteVotingRecordsByIds(String[] ids)
    {
        return votingRecordsMapper.deleteVotingRecordsByIds(ids);
    }

    /**
     * 删除投票记录信息
     * 
     * @param id 投票记录主键
     * @return 结果
     */
    @Override
    public int deleteVotingRecordsById(String id)
    {
        return votingRecordsMapper.deleteVotingRecordsById(id);
    }
}
